using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class BuildingGhost : MonoBehaviour
{
    public BuildingTypeListSO buildingTypeList;
    public static BuildingGhost instance;

    public GameObject spriteObject;
    private void Awake() {
        spriteObject = transform.Find("ghost").gameObject;
        Hide();

        instance = this;
    }

    private void Update() {
        transform.position = GlobalScript.instance.GetMouseWorldPosition();
    }

    public void Show(Sprite ghostSprite){
        spriteObject.gameObject.SetActive(true);
        spriteObject.GetComponent<SpriteRenderer>().sprite = ghostSprite;//切换虚影图像
    }
    public void Hide(){
        spriteObject.gameObject.SetActive(false);
    }

}
